home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagn_r.zip / NUMBERS.SWG / 0006_BIT_ROT3.PAS.pas < prev    next >
Pascal/Delphi Source File  |  1993-05-28  |  524b  |  34 lines

  1. {
  2. SEAN PALMER
  3. }
  4.  
  5. Function rolW(b : Word; n : Byte) : Word; Assembler;
  6. Asm
  7.   mov ax, b
  8.   mov cl, n
  9.   rol ax, cl
  10. end;
  11.  
  12. Function rolB(b, n : Byte) : Byte; Assembler;
  13. Asm
  14.   mov al, b
  15.   mov cl, n
  16.   rol al, cl
  17. end;
  18.  
  19. Function rolW1(b : Word) : Word; Assembler;
  20. Asm
  21.   mov ax, b
  22.   rol ax, 1
  23. end;
  24.  
  25. { These would be better off as Inline Functions, such as... }
  26.  
  27. Function IrolW1(b : Word) : Word;
  28. Inline(
  29.   $58/          {pop ax}
  30.   $D1/$C0);     {rol ax,1}
  31.  
  32. { because no Function call is generated. }
  33.  
  34.